package com.truyen.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.truyen.persistence.dao.SearchLoaiTruyenTinhCamDao;
import com.truyen.persistence.entity.LoaiTruyenChu;
import com.truyen.persistence.entity.SearchLoaiTruyenTinhCam;
import com.truyen.persistence.entity.TruyenTinhCam;
import com.truyen.service.SearchLoaiTruyenTinhCamService;
import com.truyen.utils.PagingInfo;


@Service
public class SearchLoaiTruyenTinhCamServiceImpl implements SearchLoaiTruyenTinhCamService {
	
	@Autowired
	private SearchLoaiTruyenTinhCamDao searchLoaiTruyenTinhCamDao;

	@Override
	public void save(SearchLoaiTruyenTinhCam entity) {
		searchLoaiTruyenTinhCamDao.save(entity);
	}

	@Override
	public SearchLoaiTruyenTinhCam findById(Long id) {
		return searchLoaiTruyenTinhCamDao.findById(id);
	}

	@Override
	public List<SearchLoaiTruyenTinhCam> getAll() {
		return searchLoaiTruyenTinhCamDao.findAll();
	}

	@Override
	public SearchLoaiTruyenTinhCam findByProperty(String column, Object value) {
		List<SearchLoaiTruyenTinhCam> lst = searchLoaiTruyenTinhCamDao.findByProperty(column, value);
		return (lst.size()>0)?lst.get(0):null;
	}

	@Override
	public List<SearchLoaiTruyenTinhCam> getAllLst(String kwSearch, String sort, String sortBy,
			PagingInfo pInfo) {
		return searchLoaiTruyenTinhCamDao.getAllLst(kwSearch,sort,sortBy,pInfo);
	}

	@Override
	public SearchLoaiTruyenTinhCam findByLoaiTruyenTinhCamVTruyenTinhCam(
			LoaiTruyenChu loaiTruyenChu, TruyenTinhCam truyen) {
		return searchLoaiTruyenTinhCamDao.findByLoaiTruyenTinhCamVTruyenTinhCam(loaiTruyenChu,truyen);
	}

	@Override
	public List<SearchLoaiTruyenTinhCam> getLstByLoaiTruyenTinhCamWithPaging(
			LoaiTruyenChu loaiTruyenChu, String orderBy, PagingInfo pInfo) {
		return searchLoaiTruyenTinhCamDao.getLstByLoaiTruyenTinhCamWithPaging(loaiTruyenChu,orderBy,pInfo);
	}


}
